package old.coordinate;

import habitables.HabitableModel;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.HashSet;

import javax.vecmath.Vector3d;

import model.PhysicalDataModel;

import com.jme3.math.Vector3f;

import stars.StarModel;
import stars.starGroups.StarGroupModel;
import utilities.IDGenerator;
import utilities.Key;

/*
 * Holds a collection of references to objects that all exist at a single point in space.
 */
public class CoordinateModel extends PhysicalDataModel {
	
	protected ArrayList<Key> habitables = new ArrayList<Key>();
	protected ArrayList<Key> stars = new ArrayList<Key>();
	protected ArrayList<Key> starGroups = new ArrayList<Key>();
	//private HashSet<Key> starSystemKeys = new HashSet<Key>();
	//private HashSet<MFleet> fleetKeys = new HashSet<MFleet>();
	//private HashSet<MOrbitalCity> orbitalCityKeys = new HashSet<MOrbitalCity>();
	//private HashSet<MInfrastructure> infrastructure = new HashSet<MInfrastructure>();
	//private HashSet<MArmy> armyKeys = new HashSet<MArmy>();	
	
	//Create add and remove methods for each of the above.
	private Vector3f location = new Vector3f();
	private Vector3f velocity = new Vector3f();
	
	public CoordinateModel(Vector3f coords)
	{
		this.location.set(coords);
		this.velocity.set(0, 0, 0);		
	}
	
	public CoordinateModel(Vector3f coords, Vector3f delta)
	{
		this.location.set(coords);
		this.velocity.set(delta);		
	}
	
	public Vector3f getLocation()
	{
		return location;
	}
	
	public void setLocation(Vector3f location)
	{
		this.location = location;
	}
	
	public Vector3f getVelocity()
	{
		return velocity;
	}
	
	public void setVelocity(Vector3f velocity)
	{
		this.velocity = velocity;
	}

	public void addStarKeys(ArrayList<Key> stars) {
		this.stars.addAll(stars);
	}
	
	public void addStarKey(Key star) {
		this.stars.add(star);
	}
	
	public boolean containsStarKey(Key star) {
		return (stars.contains(star));
	}
	
	public ArrayList<Key> getStarKeys() {
		return stars;
	}
}
